package com.example.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author testjava
 * @since 2022-08-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ForumTopic implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "tid", type = IdType.AUTO)
    private Integer tid;
    private String title;
    private String content;
    @TableField("postTime")
    private Date postTime;
    @TableField("authorId")
    private Integer authorId;
    @TableField("ipAddress")
    private String ipAddress;
    @TableField("lastUpdateTime")
    private Date lastUpdateTime;//最后更新时间,最后回复时间
    private Integer type;// 主题类型  0表示普通帖 1表示精华帖 2表示置顶帖
    @TableField("forumId")
    private Integer forumId;
    @TableField("replyCount")
    private Integer replyCount;
    @TableField("lastReplyId")
    private Integer lastReplyId;

    @TableField(exist = false)
    private Forum forum;// 当前主题属于哪个版块
    @TableField(exist = false)
    private List<ForumReply> replies ;// 当前主题对应的回复集合
    @TableField(exist = false)
    private ForumReply lastReply;//当前主题对应的最后一个回复
    @TableField(exist = false)
    private User author;//作者

}
